﻿namespace Cuofrisp.Console.Tools
{
    public static class Ranges
    {
        public static IEnumerable<(int, int)> Range2d(int count)
        {
            for (int a = 0; a < count; a++)
            {
                for (int b = 0; b < count; b++)
                {
                    yield return (a, b);
                }
            }
        }

        public static IEnumerable<(int, int, int)> Range3d(int count)
        {
            for (int a = 0; a < count; a++)
            {
                for (int b = 0; b < count; b++)
                {
                    for (int c = 0; c < count; c++)
                    {
                        yield return (a, b, c);
                    }
                }
            }
        }

        public static IEnumerable<(int, int, int, int)> Range4d(int count)
        {
            for (int a = 0; a < count; a++)
            {
                for (int b = 0; b < count; b++)
                {
                    for (int c = 0; c < count; c++)
                    {
                        for (int d = 0; d < count; d++)
                        {
                            yield return (a, b, c, d);
                        }
                    }
                }
            }
        }
    }
}
